/**
 * Created by Gu on 2016/3/21.
 */
angular.module('metalabPartnerApp').directive("metaImageClose", function () {
    return {
        restrict: 'A',
        transclude: true,
        scope: {
            content: '@metaImgMini'
        },
        template: "<a href='javascript:void(0)' class='close-button' ng-click='imageCollapse()'><i class='glyphicon glyphicon-off'></i>{{isClosed?'展开':'收起'}}</a><div ng-transclude></div>",
        link: function (scope, elem, attrs) {
            scope.isClosed = false;
            elem[0].classList.add("close-container");
            scope.imageCollapse = function () {
                if (scope.isClosed) {
                    elem[0].classList.remove("off");
                    scope.isClosed = false;
                } else {
                    elem[0].classList.add("off");
                    scope.isClosed = true;
                }
            };
        }
    };
}).directive("openView", function () {
    return {
        restrict: 'A',
        transclude: true,
        template: "<div><a href='javascript:void(0)' class='close-button' ng-click='imageCollapse()'><i class='glyphicon glyphicon-off'></i>{{isClosed?'展开':'收起'}}</a><div ng-transclude></div></div></div>"
    }
}).directive("closeView", function () {

});
